<%@ page contentType="text/html;charset=UTF-8" %>

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Sample title</title>
    <g:javascript library="prototype" src="prototype/prototype.js" />
    <meta name="layout" content="main" />
  </head>
  <body>
      <div id="pageBody">
            <h1>Update Product - Wine</h1>
            
            <br/>${flash.message}<br/>

            <g:form name="updateWineProductForm" controller="catalogueManagement" action="updateWineProduct">

              <input type="hidden" name="id" value="${productId}"/>
              <input type="hidden" name="productType" value="${productType}"/>
              <img src="${productImageUrl}" alt="" height="150px"/><br/><br/>
              Product Name: <input type="text" name="productName" value="${productName}"/><br/>
              Description: <input type="text" name="description" value="${productDescription}"/><br/>
              Image: <input type="file" accept="image/*" name="productImage"/><br/>
              Product Type: ${productType}<br/>

              <br/>
              <h3>Product Options</h3>
        <!--      if possible maybe can make a list of product options returned by service web service-->
              <u>For Wine</u><br/>
              Wine Type: <g:select name="wineType" from="${wineTypes.wineTypeName}" noSelection="['':'']" 
                      onchange="${remoteFunction(
                                  controller:'catalogueManagement', 
                                  action:'getWineVarietalsOfWineType', 
                                  update:'wineVarietal',
                                  params:'\'wineTypeName=\' + this.value')}"
                      value="${wineTypeName}"/><br/>
              Wine Varietal: <g:select name="wineVarietal" from="${wineVarietalsOnce.wineVarietalName}" value="${wineVarietalName}"/><br/>
              Wine Region: <g:select name="wineRegion" from="${wineRegions.wineRegionName}" value="${wineRegionName}"/><br/>


<!--              <u>For Gift</u><br/>



              <u>For Wine</u><br/>-->

              <input type="submit"/>

            </g:form>
      </div>
  </body>
</html>